<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>TurtleDB: src/ca/uqac/dim/turtledb/Table.java Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">TurtleDB
   
   </div>
   <div id="projectbrief">A mini distributed database system</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_table_8java.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">src/ca/uqac/dim/turtledb/Table.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_table_8java.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*-------------------------------------------------------------------------</span>
<a name="l00002"></a>00002 <span class="comment">    Simple distributed database engine</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2012  Sylvain Hallé</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This program is free software: you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment">    along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 <span class="comment"> -------------------------------------------------------------------------*/</span>
<a name="l00018"></a>00018 <span class="keyword">package </span>ca.uqac.dim.turtledb;
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="keyword">import</span> java.util.*;
<a name="l00021"></a>00021 
<a name="l00035"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">00035</a> <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a> <span class="keyword">extends</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a>
<a name="l00036"></a>00036 {
<a name="l00037"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">00037</a>   <span class="keyword">protected</span> List&lt;Tuple&gt; <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>;
<a name="l00038"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">00038</a>   <span class="keyword">protected</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a>;
<a name="l00039"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aca90042d676729668163a64a9c075d90">00039</a>   <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aca90042d676729668163a64a9c075d90">m_cursor</a>;
<a name="l00040"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">00040</a>   <span class="keyword">protected</span> String <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>;
<a name="l00041"></a>00041   
<a name="l00045"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">00045</a>   <span class="comment">/*package*/</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">Table</a>()
<a name="l00046"></a>00046   {
<a name="l00047"></a>00047     super();
<a name="l00048"></a>00048     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a> = <span class="keyword">new</span> ArrayList&lt;Tuple&gt;();
<a name="l00049"></a>00049     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a> = <span class="stringliteral">&quot;&quot;</span>;
<a name="l00050"></a>00050   }
<a name="l00051"></a>00051   
<a name="l00052"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ae3427ed0a30019eb8b74c9ab979f3c04">00052</a>   <span class="comment">/*package*/</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">Table</a>(String s)
<a name="l00053"></a>00053   {
<a name="l00054"></a>00054     <span class="keyword">this</span>();
<a name="l00055"></a>00055     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a> = s;
<a name="l00056"></a>00056   }
<a name="l00057"></a>00057   
<a name="l00062"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19e03b8dfa939e27ced2524f68df362d">00062</a>   <span class="keyword">public</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">Table</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a> r)
<a name="l00063"></a>00063   {
<a name="l00064"></a>00064     <span class="keyword">this</span>();
<a name="l00065"></a>00065     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">copy</a>(r);
<a name="l00066"></a>00066   }
<a name="l00067"></a>00067   
<a name="l00075"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a07b9a138dc1d83a847ce9493b8829573">00075</a>   <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a07b9a138dc1d83a847ce9493b8829573">setName</a>(String name)
<a name="l00076"></a>00076   {
<a name="l00077"></a>00077     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a> = name;
<a name="l00078"></a>00078     <span class="keywordflow">for</span> (<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> t : <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>)
<a name="l00079"></a>00079       t.setTable(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>);
<a name="l00080"></a>00080   }
<a name="l00081"></a>00081 
<a name="l00086"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a98634d859b5c4cef0e8214f0fafcc798">00086</a>   <span class="comment">/*package*/</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">Table</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> sch)
<a name="l00087"></a>00087   {
<a name="l00088"></a>00088     <span class="keyword">this</span>();
<a name="l00089"></a>00089     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a> = sch;
<a name="l00090"></a>00090   }
<a name="l00091"></a>00091   
<a name="l00096"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#acb4bb7666131acb57ae0663c5ef2a65f">00096</a>   <span class="keyword">public</span> String <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#acb4bb7666131acb57ae0663c5ef2a65f">getName</a>()
<a name="l00097"></a>00097   {
<a name="l00098"></a>00098     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>;
<a name="l00099"></a>00099   }
<a name="l00100"></a>00100   
<a name="l00105"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a226e2304771b71716a8961a4a0a8446e">00105</a>   <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a226e2304771b71716a8961a4a0a8446e">setSchema</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> sch)
<a name="l00106"></a>00106   {
<a name="l00107"></a>00107         <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> s = <span class="keyword">new</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a>(sch);
<a name="l00108"></a>00108         s.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html#aa014f83c8589e07827d76cc3f7c489c7">setTableName</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>);
<a name="l00109"></a>00109     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a> = s;
<a name="l00110"></a>00110   }
<a name="l00111"></a>00111 
<a name="l00112"></a>00112   @Override
<a name="l00113"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ad4377b0b6d6bd9b573db9dd3824fd08f">00113</a>   <span class="keyword">public</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ad4377b0b6d6bd9b573db9dd3824fd08f">getSchema</a>()
<a name="l00114"></a>00114   {
<a name="l00115"></a>00115     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a>;
<a name="l00116"></a>00116   }
<a name="l00117"></a>00117   
<a name="l00130"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">00130</a>   <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">put</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> t)
<a name="l00131"></a>00131   {
<a name="l00132"></a>00132     assert t != null;
<a name="l00133"></a>00133     assert t.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html#aa20fa8a28c37cb86d0b422ce8db63a0b">size</a>() == <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a>.size();
<a name="l00134"></a>00134     <span class="comment">// Gives the current table&#39;s name to all the tuple&#39;s attributes</span>
<a name="l00135"></a>00135     <span class="keywordflow">if</span> (<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a> != null &amp;&amp; !<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>.isEmpty())
<a name="l00136"></a>00136       t.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html#a61a5e3467ce2c275167bd5ae4d4d1293">setTable</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a>);
<a name="l00137"></a>00137     <span class="keywordtype">int</span> index = Collections.binarySearch(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>, t);
<a name="l00138"></a>00138     <span class="keywordflow">if</span> (index &lt; 0) <span class="comment">// We silently ignore tuples that are already present</span>
<a name="l00139"></a>00139       <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.add(-index-1, t);
<a name="l00140"></a>00140   }
<a name="l00141"></a>00141   
<a name="l00148"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a6d4c40243f777b5cb535b5b2435e24c3">00148</a>   <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a6d4c40243f777b5cb535b5b2435e24c3">putAll</a>(Collection&lt;Tuple&gt; tuples)
<a name="l00149"></a>00149   {
<a name="l00150"></a>00150     <span class="keywordflow">for</span> (<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> t : tuples)
<a name="l00151"></a>00151     {
<a name="l00152"></a>00152       <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">put</a>(t);
<a name="l00153"></a>00153     }
<a name="l00154"></a>00154   }
<a name="l00155"></a>00155   
<a name="l00156"></a>00156   @Override
<a name="l00157"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a45af187301ba83ec19575c957db219d0">00157</a>   <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a45af187301ba83ec19575c957db219d0">accept</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_query_visitor.html">QueryVisitor</a> v) <span class="keywordflow">throws</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_empty_query_visitor.html">EmptyQueryVisitor</a>.VisitorException
<a name="l00158"></a>00158   {
<a name="l00159"></a>00159     v.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_empty_query_visitor.html#affb34d245e72bc5521f60b3d9a3ddf84">visit</a>(<span class="keyword">this</span>);
<a name="l00160"></a>00160   }
<a name="l00161"></a>00161   
<a name="l00169"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">00169</a>   <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">copy</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a> r)
<a name="l00170"></a>00170   {
<a name="l00171"></a>00171     assert r != null;
<a name="l00172"></a>00172     <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a> = r.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#a7a7af53642133603e51e04d79f938286">getSchema</a>();
<a name="l00173"></a>00173     Iterator&lt;Tuple&gt; i = r.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#acd5caf578d0fd8af02e230004dd6a1e7">iterator</a>();
<a name="l00174"></a>00174     <span class="keywordflow">while</span> (i.hasNext())
<a name="l00175"></a>00175     {
<a name="l00176"></a>00176       <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> t = i.next();
<a name="l00177"></a>00177       this.<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">put</a>(t);
<a name="l00178"></a>00178     }
<a name="l00179"></a>00179   }
<a name="l00180"></a>00180   
<a name="l00181"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a34f929a0250eea5bb1bc7e515840141a">00181</a>   <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a34f929a0250eea5bb1bc7e515840141a">getCardinality</a>()
<a name="l00182"></a>00182   {
<a name="l00183"></a>00183     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.size();
<a name="l00184"></a>00184   }
<a name="l00185"></a>00185   
<a name="l00196"></a>00196   @Override
<a name="l00197"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a092526a7a8d2c0630d295d0bc7f47c9a">00197</a>   <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a092526a7a8d2c0630d295d0bc7f47c9a">contains</a>(<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> tup)
<a name="l00198"></a>00198   {
<a name="l00199"></a>00199     <span class="keywordflow">if</span> (tup == null)
<a name="l00200"></a>00200       <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00201"></a>00201     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.contains(tup);
<a name="l00202"></a>00202   }
<a name="l00203"></a>00203   
<a name="l00204"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a615684670db2aebde7f60439f4dd4176">00204</a>   <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a615684670db2aebde7f60439f4dd4176">tupleCount</a>()
<a name="l00205"></a>00205   {
<a name="l00206"></a>00206     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.size();
<a name="l00207"></a>00207   }
<a name="l00208"></a>00208   
<a name="l00209"></a>00209   @Override
<a name="l00210"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aa0537277d7f1335610e0e08ca91ca8de">00210</a>   <span class="keyword">public</span> <span class="keyword">final</span> <span class="keywordtype">boolean</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aa0537277d7f1335610e0e08ca91ca8de">isLeaf</a>()
<a name="l00211"></a>00211   {
<a name="l00212"></a>00212     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00213"></a>00213   }
<a name="l00214"></a>00214 
<a name="l00215"></a>00215   @Override
<a name="l00216"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8616d5a42e073876c16bdb41bd17baa5">00216</a>   <span class="keyword">public</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_stream_iterator.html">RelationStreamIterator</a> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8616d5a42e073876c16bdb41bd17baa5">streamIterator</a>()
<a name="l00217"></a>00217   {
<a name="l00218"></a>00218     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html">TableStreamIterator</a>();
<a name="l00219"></a>00219   }
<a name="l00220"></a>00220   
<a name="l00221"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html">00221</a>   <span class="keyword">protected</span> <span class="keyword">class </span><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html">TableStreamIterator</a> <span class="keyword">extends</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_stream_iterator.html">RelationStreamIterator</a>
<a name="l00222"></a>00222   {
<a name="l00223"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">00223</a>     <span class="keyword">protected</span> Iterator&lt;Tuple&gt; <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">m_iterator</a>;
<a name="l00224"></a>00224     
<a name="l00225"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a0f42cdc90b7ad0aaed1c38cadd9f342d">00225</a>     <span class="keyword">public</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a0f42cdc90b7ad0aaed1c38cadd9f342d">TableStreamIterator</a>()
<a name="l00226"></a>00226     {
<a name="l00227"></a>00227       <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">m_iterator</a> = <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.iterator();
<a name="l00228"></a>00228     }
<a name="l00229"></a>00229 
<a name="l00230"></a>00230     @Override
<a name="l00231"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#ae97fa01f1870825b84bc6f1b8f6becab">00231</a>     <span class="keyword">protected</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#ae97fa01f1870825b84bc6f1b8f6becab">internalNext</a>()
<a name="l00232"></a>00232     {
<a name="l00233"></a>00233       <span class="keywordflow">if</span> (<a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">m_iterator</a>.hasNext())
<a name="l00234"></a>00234         <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">m_iterator</a>.next();
<a name="l00235"></a>00235       <span class="keywordflow">return</span> null;
<a name="l00236"></a>00236     }
<a name="l00237"></a>00237     
<a name="l00238"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#abe99e65f2166319af3d523c548f22140">00238</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#abe99e65f2166319af3d523c548f22140">reset</a>()
<a name="l00239"></a>00239     {
<a name="l00240"></a>00240       super.reset();
<a name="l00241"></a>00241       <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html#a3fe10242064f6d769a0ef933e58dfda6">m_iterator</a> = <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.iterator();
<a name="l00242"></a>00242     }
<a name="l00243"></a>00243   }
<a name="l00244"></a>00244   
<a name="l00245"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19846d1f280e9a8658a751b5b6e23bf6">00245</a>   <span class="keyword">protected</span> Iterator&lt;Tuple&gt; <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19846d1f280e9a8658a751b5b6e23bf6">tupleIterator</a>()
<a name="l00246"></a>00246   {
<a name="l00247"></a>00247     <span class="keywordflow">return</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a>.iterator();
<a name="l00248"></a>00248   }
<a name="l00249"></a>00249   
<a name="l00250"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_cache_iterator.html">00250</a>   <span class="keyword">protected</span> <span class="keyword">class </span><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_cache_iterator.html">TableCacheIterator</a> <span class="keyword">extends</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_cache_iterator.html">RelationCacheIterator</a>
<a name="l00251"></a>00251   {
<a name="l00252"></a>00252 
<a name="l00253"></a>00253     @Override
<a name="l00254"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_cache_iterator.html#aff89ddf1dca084bd01519478b37de07b">00254</a>     <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_cache_iterator.html#aff89ddf1dca084bd01519478b37de07b">getIntermediateResult</a>()
<a name="l00255"></a>00255     {
<a name="l00256"></a>00256       <span class="comment">// The intermediate result is the table itself</span>
<a name="l00257"></a>00257       super.m_intermediateResult = <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a>.this; 
<a name="l00258"></a>00258     }
<a name="l00259"></a>00259     
<a name="l00260"></a>00260   }
<a name="l00261"></a>00261 
<a name="l00262"></a>00262   @Override
<a name="l00263"></a><a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a5b3c6b4fb85f117600334e229d4075a0">00263</a>   <span class="keyword">public</span> <a class="code" href="interfaceca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_iterator.html">RelationIterator</a> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a5b3c6b4fb85f117600334e229d4075a0">cacheIterator</a>()
<a name="l00264"></a>00264   {
<a name="l00265"></a>00265     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html">TableStreamIterator</a>();
<a name="l00266"></a>00266   }
<a name="l00267"></a>00267 
<a name="l00268"></a>00268 }
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_table_8java.html">Table.java</a>      </li>

    <li class="footer">Generated on Fri Dec 7 2012 18:55:40 for TurtleDB by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
